import QtQuick 2.0

Row {
	id: row
	property string img: ""
	property int num: 0
	property string drawStr: ""
	property bool canMakeNum: false
	spacing: 0

	onNumChanged: {
		if (canMakeNum) {
			makeNum();
		}
	}

	function setDrawStr() {
		drawStr = "" + num;
	}

	function makeNum() {
		for (var i = 0; i < row.children.length; ++i)
			row.children[i].destroy();
		setDrawStr();
		var obj;
		for (i = 0; i < drawStr.length; ++i) {
			var s = 'import QtQuick 2.2;Image{source:"' + img + drawStr[i] + '"}';
			obj = Qt.createQmlObject(s, row);
		}
		row.height = obj.heigth;
		row.width = obj.width * drawStr.length;
	}

	Component.onCompleted: {
		canMakeNum = true;
		makeNum();
	}
}

